home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Newton Sample Code 1.1 / Miscellaneous / Checkbook-3 / Project Data < prev    next >
Encoding:
Text File  |  1994-03-09  |  1.6 KB  |  52 lines  |  [TEXT/ttxt]

  1. constant kAppSymbol := '|Checkbook:PIETraining|;
  2. constant kAppObject := '["Check", "Checks"];
  3. constant kSoupName := "Checkbook:PIETraining";
  4. constant kCheckFormatSymbol := '|CheckFormat:Checkbook:PIETraining|;
  5. constant kSoupIndexes := '[
  6.     {structure: slot, path: date, type: int}, 
  7.     {structure: slot, path:number, type: int},
  8. ];
  9. constant kAppName := "Checkbook";
  10. constant kMaxApplicationWidth := 800;
  11. constant kMaxApplicationHeight := 1600;
  12.  
  13. DefConst('kMinutesPerDay, 24 * 60);
  14.  
  15.  
  16. InstallScript := func(packageFrame)
  17. begin
  18.     // to set up routing
  19.     routing.(kAppSymbol) := packageFrame.theForm.routingFrame;
  20.     GetRoot().(kCheckFormatSymbol) := BuildContext(packageFrame.theForm.printFormat);   
  21.  
  22.     // To be notified of changes to the soup (including a changed folder)
  23.     AddArraySlot(soupNotify, kSoupName);
  24.     AddArraySlot(soupNotify, kAppSymbol);
  25.  
  26.     // for Find All
  27.     AddArraySlot(findApps, kAppSymbol);
  28.  
  29.     // for IA
  30.     packageFrame.taskTemplateID := RegTaskTemplate(packageFrame.theForm.taskTemplate);
  31. end;
  32.  
  33. RemoveScript := func(packageFrame)
  34. begin
  35.     // remove routing
  36.     RemoveSlot(routing, kAppSymbol);
  37.     RemoveSlot(GetRoot(), kCheckFormatSymbol);
  38.  
  39.     // remove soup name and app symbol from soupNotify array
  40.     local soupNotifyPos := ArrayPos(soupNotify, kAppSymbol, 0, nil);
  41.     ArrayRemoveCount(soupNotify, soupNotifyPos - 1, 2);
  42.  
  43.     // for Find All
  44.     SetRemove(findApps, kAppSymbol);
  45.  
  46.     // for IA
  47.     if packageFrame.taskTemplateID then begin
  48.         UnRegTaskTemplate(packageFrame.taskTemplateID);
  49.         packageFrame.taskTemplateID := nil;
  50.     end;
  51. end;
  52.